package com.sojson.datasource.web.controller;


import com.sojson.datasource.common.model.Stock;
import com.sojson.datasource.one.mapper.OneStockMapper;
import com.sojson.datasource.two.mapper.TwoStockMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RequestMapping("api")
@RestController
public class IndexController {

    @Autowired
    OneStockMapper oneStockMapper;

    @Autowired
    TwoStockMapper twoStockMapper;

    @RequestMapping("")
    public Map<String,Object> index(){
        Map<String,Object> result = new HashMap<>();
        Stock entity = oneStockMapper.selectByPrimaryKey(1);
        Stock twoEntity = twoStockMapper.selectByPrimaryKey(1);

        result.put("entity",entity);
        result.put("twoEntity",twoEntity);

        return result;
    }
}
